package com.cn.controller;

import com.cn.pojo.User;
import com.cn.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

@Controller
public class UserController {
    @Autowired
    private UserService userService;

    /**
     * 添加单个用户
     * @return 1表示成功，0表示失败
     */
    public int addUser(User user) {
        return userService.addUser(user);
    }
    /**
     * 根据用户名查询用户Id
     */
    public int queryUserIdByName(String userName) {
        return userService.queryUserIdByName(userName);
    }
}
